/*
 *   Copyright 2021 zzh
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 *
 */

package com.aduib.boot.common.SPI.metadata;

import java.lang.annotation.Annotation;
import java.lang.reflect.AccessibleObject;

/**
 * @description: DefaultMethodMetaData
 * @author: zzh
 * @date: 2021/11/1 13:30
 */
public class DefaultConstructorMetaData extends AbstractMetaData implements ConstructorMetaData {

  private Class<?>[] parameterTypes;

  private Object[] parameterValues;

  private Class<?>[] exceptionTypes;

  public DefaultConstructorMetaData(
      AccessibleObject accessibleObject,
      String simpleName,
      int modifiers,
      Annotation[] annotations,
      Class<?>[] parameterTypes,
      Object[] parameterValues,
      Class<?>[] exceptionTypes) {
    super(annotations, accessibleObject, simpleName, modifiers);
    this.parameterTypes = parameterTypes;
    this.parameterValues = parameterValues;
    this.exceptionTypes = exceptionTypes;
  }

  @Override
  public Class<?>[] getParameterTypes() {
    return parameterTypes;
  }

  @Override
  public Object[] getParameters() {
    return parameterValues;
  }

  @Override
  public Class<?>[] exceptionTypes() {
    return exceptionTypes;
  }

  @Override
  public void setParameterValues(Object[] parameterValues) {
    this.parameterValues = parameterValues;
  }
}
